/*

 * @(#)XlsFont.java

 */

package com.stony.poie.ext;

import org.apache.poi.hssf.usermodel.HSSFFont;

/**
 * 
 * Represents a Font used in a XlsFile.
 * 
 * <p>
 * 
 * Last modified: January 24, 2006
 * 
 * 
 * 
 * @author Thomas Wu
 * 
 * @version 1.0.0
 * 
 */

public final class XlsFont {

	/* Normal font color. */

	public final static short COLOR_NORMAL = HSSFFont.COLOR_NORMAL;

	/* Red font color. */

	public final static short COLOR_RED = HSSFFont.COLOR_RED;

	/* Default font family name. */

	private final static String DEFAULT_NAME = "Arial";

	/* Default font size. */

	private final static short DEFAULT_HEIGHT = 10;

	/* Jakarta POI library related. */

	private HSSFFont hssfFont;

	/* Font family name. */

	private String fontName;

	/* Font size. */

	private short height;

	/* Font color. */

	private short color;

	/* Wheather font is bold or not. */

	private boolean bold;

	/* Wheather font is italic or not. */

	private boolean italic;

	/* Wheather font is underline or not. */

	private boolean underline;

	/* Wheather font is strikeout or not. */

	private boolean strikeout;

	/**
	 * 
	 * Construct a new XlsFont instance.
	 * 
	 */

	public XlsFont() {

		hssfFont = null;

		fontName = DEFAULT_NAME;

		height = DEFAULT_HEIGHT;

		color = COLOR_NORMAL;

		bold = false;

		italic = false;

		underline = false;

		strikeout = false;

	}

	/**
	 * 
	 * @return wheather font is bold or not.
	 * 
	 */

	public boolean isBold() {

		return bold;

	}

	/**
	 * 
	 * @param bold
	 *            wheather font is bold or not.
	 * 
	 */

	public void setBold(boolean bold) {

		this.bold = bold;

	}

	/**
	 * 
	 * @return font's color..
	 * 
	 */

	public short getColor() {

		return color;

	}

	/**
	 * 
	 * @param color
	 *            font's color.
	 * 
	 */

	public void setColor(short color) {

		this.color = color;

	}

	/**
	 * 
	 * @return font's size.
	 * 
	 */

	public short getHeight() {

		return height;

	}

	/**
	 * 
	 * @param height
	 *            font's size.
	 * 
	 */

	public void setHeight(short height) {

		this.height = height;

	}

	/**
	 * 
	 * Jakarta POI library related.
	 * 
	 * For XlsEngine to call.
	 * 
	 */

	public HSSFFont getHssfFont() {

		return hssfFont;

	}

	/**
	 * 
	 * Jakarta POI library related.
	 * 
	 * For XlsEngine to call.
	 * 
	 */

	public void setHssfFont(HSSFFont hssfFont) {

		this.hssfFont = hssfFont;

	}

	/**
	 * 
	 * @return wheather font is italic or not.
	 * 
	 */

	public boolean isItalic() {

		return italic;

	}

	/**
	 * 
	 * @param italic
	 *            wheather font is italic or not.
	 * 
	 */

	public void setItalic(boolean italic) {

		this.italic = italic;

	}

	/**
	 * 
	 * @return name of font family.
	 * 
	 */

	public String getFontName() {

		return fontName;

	}

	/**
	 * 
	 * @param fontName
	 *            name of font family.
	 * 
	 */

	public void setFontName(String fontName) {

		this.fontName = fontName;

	}

	/**
	 * 
	 * @return wheather font is strikeout or not.
	 * 
	 */

	public boolean isStrikeout() {

		return strikeout;

	}

	/**
	 * 
	 * @param strikeout
	 *            wheather font is strikeout or not.
	 * 
	 */

	public void setStrikeout(boolean strikeout) {

		this.strikeout = strikeout;

	}

	/**
	 * 
	 * @return wheather font is underline or not.
	 * 
	 */

	public boolean isUnderline() {

		return underline;

	}

	/**
	 * 
	 * @param underline
	 *            wheather font is underline or not.
	 * 
	 */

	public void setUnderline(boolean underline) {

		this.underline = underline;

	}

}
